#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
using namespace std;
int cmp(int a,int b){
    return a>b;
}
int main(){
    char n;
    int a=0,b=0;
   while(scanf("%c",&n)!=EOF){
       if(n=='0')break;
       if(n=='A')a++;
       if(n=='B') b++;
   }
   if(a>b)cout<<"A"<<endl;
    else if(a==b)cout<<"E"<<endl;
    else cout<<"B"<<endl;
    return  0;
}
